package com.ruoyi.locate.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.locate.mapper.WWarehouseMapGridMapper;
import com.ruoyi.locate.domain.WWarehouseMapGrid;
import com.ruoyi.locate.service.IWWarehouseMapGridService;

/**
 * 仓位网格Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-06 17:39:13
 */
@Service
public class WWarehouseMapGridServiceImpl implements IWWarehouseMapGridService 
{
    @Autowired
    private WWarehouseMapGridMapper wWarehouseMapGridMapper;

    /**
     * 查询仓位网格
     * 
     * @param gridId 仓位网格主键
     * @return 仓位网格
     */
    @Override
    public WWarehouseMapGrid selectWWarehouseMapGridByGridId(Long gridId)
    {
        return wWarehouseMapGridMapper.selectWWarehouseMapGridByGridId(gridId);
    }

    /**
     * 查询仓位网格列表
     * 
     * @param wWarehouseMapGrid 仓位网格
     * @return 仓位网格
     */
    @Override
    public List<WWarehouseMapGrid> selectWWarehouseMapGridList(WWarehouseMapGrid wWarehouseMapGrid)
    {
        return wWarehouseMapGridMapper.selectWWarehouseMapGridList(wWarehouseMapGrid);
    }

    /**
     * 新增仓位网格
     * 
     * @param wWarehouseMapGrid 仓位网格
     * @return 结果
     */
    @Override
    public int insertWWarehouseMapGrid(WWarehouseMapGrid wWarehouseMapGrid)
    {
        wWarehouseMapGrid.setCreateTime(DateUtils.getNowDate());
        return wWarehouseMapGridMapper.insertWWarehouseMapGrid(wWarehouseMapGrid);
    }

    /**
     * 修改仓位网格
     * 
     * @param wWarehouseMapGrid 仓位网格
     * @return 结果
     */
    @Override
    public int updateWWarehouseMapGrid(WWarehouseMapGrid wWarehouseMapGrid)
    {
        wWarehouseMapGrid.setUpdateTime(DateUtils.getNowDate());
        return wWarehouseMapGridMapper.updateWWarehouseMapGrid(wWarehouseMapGrid);
    }

    /**
     * 批量删除仓位网格
     * 
     * @param gridIds 需要删除的仓位网格主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseMapGridByGridIds(Long[] gridIds)
    {
        return wWarehouseMapGridMapper.deleteWWarehouseMapGridByGridIds(gridIds);
    }

    /**
     * 删除仓位网格信息
     * 
     * @param gridId 仓位网格主键
     * @return 结果
     */
    @Override
    public int deleteWWarehouseMapGridByGridId(Long gridId)
    {
        return wWarehouseMapGridMapper.deleteWWarehouseMapGridByGridId(gridId);
    }

    /**
     * 清空w_warehouse_map_grid
     */
    public int cleanWarehouseMapGrid()
    {
        return wWarehouseMapGridMapper.cleanWarehouseMapGrid();
    }

    /**
     * 查询仓位栅格
     *
     * @param parentId 仓位栅格父Id
     * @return 仓位栅格
     */
    public List<WWarehouseMapGrid> selectWWarehouseMapGridByparentId(Long parentId)
    {
        return wWarehouseMapGridMapper.selectWWarehouseMapGridByparentId(parentId);
    }
}
